package com.atguigu.spzx.common.service.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName: GuiguException
 * @Package: com.atguigu.spzx.common.service.exception
 * @Description 处理自定义异常的异常类
 * @Author 孤妤
 * @Date: 2023/12/2 10:18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GuiguException extends RuntimeException{
    private Integer code;
    private String message;
    public GuiguException(ResultCodeEnum resultCodeEnum){
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
